struct _StBinPrivate
{
ClutterActor *child;
-
- guint x_fill : 1;
- guint y_fill : 1;
};
enum
PROP_0,
PROP_CHILD,
- PROP_X_FILL,
- PROP_Y_FILL,
N_PROPS
};
GParamSpec *pspec)
{
StBin *bin = ST_BIN (gobject);
- StBinPrivate *priv = st_bin_get_instance_private (bin);
switch (prop_id)
{
st_bin_set_child (bin, g_value_get_object (value));
break;
- case PROP_X_FILL:
- st_bin_set_fill (bin,
- g_value_get_boolean (value),
- priv->y_fill);
- break;
-
- case PROP_Y_FILL:
- st_bin_set_fill (bin,
- priv->x_fill,
- g_value_get_boolean (value));
- break;
-
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}
g_value_set_object (value, priv->child);
break;
- case PROP_X_FILL:
- g_value_set_boolean (value, priv->x_fill);
- break;
-
- case PROP_Y_FILL:
- g_value_set_boolean (value, priv->y_fill);
- break;
-
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
}
CLUTTER_TYPE_ACTOR,
ST_PARAM_READWRITE);
- /**
- * StBin:x-fill:
- *
- * Whether the child should fill the horizontal allocation
- */
- props[PROP_X_FILL] =
- g_param_spec_boolean ("x-fill",
- "X Fill",
- "Whether the child should fill the "
- "horizontal allocation",
- FALSE,
- ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
-
- /**
- * StBin:y-fill:
- *
- * Whether the child should fill the vertical allocation
- */
- props[PROP_Y_FILL] =
- g_param_spec_boolean ("y-fill",
- "Y Fill",
- "Whether the child should fill the "
- "vertical allocation",
- FALSE,
- ST_PARAM_READWRITE | G_PARAM_DEPRECATED);
-
g_object_class_install_properties (gobject_class, N_PROPS, props);
}
return ((StBinPrivate *)st_bin_get_instance_private (bin))->child;
}
-
-/**
- * st_bin_set_fill:
- * @bin: a #StBin
- * @x_fill: %TRUE if the child should fill horizontally the @bin
- * @y_fill: %TRUE if the child should fill vertically the @bin
- *
- * Sets whether the child of @bin should fill out the horizontal
- * and/or vertical allocation of the parent
- */
-void
-st_bin_set_fill (StBin *bin,
- gboolean x_fill,
- gboolean y_fill)
-{
- StBinPrivate *priv;
-
- g_return_if_fail (ST_IS_BIN (bin));
-
- priv = st_bin_get_instance_private (bin);
-
- g_object_freeze_notify (G_OBJECT (bin));
-
- if (priv->x_fill != x_fill)
- {
- priv->x_fill = x_fill;
-
- g_object_notify_by_pspec (G_OBJECT (bin), props[PROP_X_FILL]);
- }
-
- if (priv->y_fill != y_fill)
- {
- priv->y_fill = y_fill;
-
- g_object_notify_by_pspec (G_OBJECT (bin), props[PROP_Y_FILL]);
- }
-
- g_object_thaw_notify (G_OBJECT (bin));
-}
-
-/**
- * st_bin_get_fill:
- * @bin: a #StBin
- * @x_fill: (out): return location for the horizontal fill, or %NULL
- * @y_fill: (out): return location for the vertical fill, or %NULL
- *
- * Retrieves the horizontal and vertical fill settings
- */
-void
-st_bin_get_fill (StBin *bin,
- gboolean *x_fill,
- gboolean *y_fill)
-{
- StBinPrivate *priv;
-
- g_return_if_fail (ST_IS_BIN (bin));
-
- priv = st_bin_get_instance_private (bin);
-
- if (x_fill)
- *x_fill = priv->x_fill;
-
- if (y_fill)
- *y_fill = priv->y_fill;
-}